﻿using System;
using System.Collections.Generic;
using System.Web;
using System.IO;

/// <summary>
///Upload 的摘要说明
/// </summary>
public class Upload : BasePage
{
    // Fields
    private string[] filenames;
    private List<string> fileNames = new List<string>();
    private string[] names;

    // Methods
    private List<string> getNextTest(string srcPath)
    {
        List<string> list = new List<string>();
        string[] fileSystemEntries = Directory.GetFileSystemEntries(srcPath);
        foreach (string str in fileSystemEntries)
        {
            if (Directory.Exists(str))
            {
                list.Add(str);
            }
        }
        return list;
    }

    private string getText(string url)
    {
        return HttpContext.Current.Server.MapPath(url);
    }

    public string setUpload()
    {
        string str = "/upfile/team/";
        string path = base.Server.MapPath("~/upfile/team/");
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        str = str + DateTime.Now.Year + "/";
        path = path + DateTime.Now.Year + "/";
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        path = path + DateTime.Now.ToString("MMdd");
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        return (str + DateTime.Now.ToString("MMdd") + "/");
    }
}

